package com.catmiw.funds.domain.middle;

import java.util.Date;

import com.catmiw.funds.tool.DateTool;

public class PeriodParamDefine implements Comparable<PeriodParamDefine>{
	public PeriodParamDefine(){	}
	public PeriodParamDefine(Date fromdate,Date todate,int weight){
		this.fromdate=fromdate;
		this.todate=todate;
		this.weight=weight;
	}
	public PeriodParamDefine(Date fromdate,Date todate){
		this(fromdate,todate,1);
	}
	public PeriodParamDefine(int fromdate,int todate,int weight){
		this(DateTool.toDate(fromdate),DateTool.toDate(todate),weight);
	}
	public PeriodParamDefine(int fromdate,int todate){
		this(DateTool.toDate(fromdate),DateTool.toDate(todate),1);
	}

	private Date fromdate;
	public Date getFromdate() {
		return fromdate;
	}
	public void setFromdate(Date fromdate) {
		this.fromdate = fromdate;
	}
	public Date getTodate() {
		return todate;
	}
	public void setTodate(Date todate) {
		this.todate = todate;
	}
	public int getWeight() {
		return weight;
	}
	public void setWeight(int weight) {
		this.weight = weight;
	}

	private Date todate;
	private int weight;
	
	public int compareTo(PeriodParamDefine o) {
		return fromdate.compareTo(o.getFromdate());
	}
}
